﻿
















  
using System;
using SubSonic.Schema;
using System.Data;
namespace MvcForum.Net.Bussiness{
	public partial class MainDB{

        public StoredProcedure Activity_List(int? PageIndex,int? PageSize){
            var sp=new StoredProcedure("Activity_List",Provider);
				sp.Command.AddParameter("PageIndex", PageIndex,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageSize", PageSize,DbType.Int32,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("TotalRows",DbType.Int32);
				
            return sp;
        }
        public StoredProcedure Activity_Save(string SessionId,int? UserId,string UserName,string IP,string PageTitle,string Location,int? ForumId,int? TopicId,string Browser,string Platform,bool? IsPrivated,int? PastMinutes){
            var sp=new StoredProcedure("Activity_Save",Provider);
				sp.Command.AddParameter("SessionId", SessionId,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("UserName", UserName,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("IP", IP,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageTitle", PageTitle,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Location", Location,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Browser", Browser,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Platform", Platform,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsPrivated", IsPrivated,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("PastMinutes", PastMinutes,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure EmailQueue_Delete(int? Id){
            var sp=new StoredProcedure("EmailQueue_Delete",Provider);
				sp.Command.AddParameter("Id", Id,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure EmailQueue_List(){
            var sp=new StoredProcedure("EmailQueue_List",Provider);
            return sp;
        }
        public StoredProcedure EmailQueue_Save(string From,string To,string Subject,string Body,short? Priority){
            var sp=new StoredProcedure("EmailQueue_Save",Provider);
				sp.Command.AddParameter("From", From,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("To", To,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Subject", Subject,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Body", Body,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Priority", Priority,DbType.Int16,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_CalcLastPost(int? ForumId,int? Topics,int? Replies){
            var sp=new StoredProcedure("Forum_CalcLastPost",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Topics", Topics,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Replies", Replies,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_Delete(string Ids){
            var sp=new StoredProcedure("Forum_Delete",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_Detail(int? ForumId){
            var sp=new StoredProcedure("Forum_Detail",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_GetLastPost(int? ForumId){
            var sp=new StoredProcedure("Forum_GetLastPost",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("TotalTopics",DbType.Int32);
				
	
				sp.Command.AddOutputParameter("TotalReplies",DbType.Int32);
				
            return sp;
        }
        public StoredProcedure Forum_List(int? ParentId){
            var sp=new StoredProcedure("Forum_List",Provider);
				sp.Command.AddParameter("ParentId", ParentId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_ListAll(int? ParentId){
            var sp=new StoredProcedure("Forum_ListAll",Provider);
				sp.Command.AddParameter("ParentId", ParentId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_ResetCounterAndLastPost(){
            var sp=new StoredProcedure("Forum_ResetCounterAndLastPost",Provider);
            return sp;
        }
        public StoredProcedure Forum_Save(int? ForumId,string Icon,string ForumName,int? ParentId,string Keywords,string Description,short? SortOrder,string RemoteUrl,bool? IsLocked,bool? AllowPostWithIn,short? ModerateType,string AllowRoles,bool? VisibleAtHomePage,bool? IncreaseMemberPosts,short? OrderBy,short? SortDirection,int? TopicsPerPage,int? PostsPerPage,bool? AllowSearch){
            var sp=new StoredProcedure("Forum_Save",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Icon", Icon,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("ForumName", ForumName,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("ParentId", ParentId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Keywords", Keywords,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Description", Description,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("SortOrder", SortOrder,DbType.Int16,ParameterDirection.Input);
					
				sp.Command.AddParameter("RemoteUrl", RemoteUrl,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsLocked", IsLocked,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("AllowPostWithIn", AllowPostWithIn,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("ModerateType", ModerateType,DbType.Int16,ParameterDirection.Input);
					
				sp.Command.AddParameter("AllowRoles", AllowRoles,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("VisibleAtHomePage", VisibleAtHomePage,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("IncreaseMemberPosts", IncreaseMemberPosts,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("OrderBy", OrderBy,DbType.Byte,ParameterDirection.Input);
					
				sp.Command.AddParameter("SortDirection", SortDirection,DbType.Byte,ParameterDirection.Input);
					
				sp.Command.AddParameter("TopicsPerPage", TopicsPerPage,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PostsPerPage", PostsPerPage,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("AllowSearch", AllowSearch,DbType.Boolean,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_StatisUpdateMaxOnline(int? PastMinutes){
            var sp=new StoredProcedure("Forum_StatisUpdateMaxOnline",Provider);
				sp.Command.AddParameter("PastMinutes", PastMinutes,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_SubList(int? ParentId){
            var sp=new StoredProcedure("Forum_SubList",Provider);
				sp.Command.AddParameter("ParentId", ParentId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_SubToParent(int? ForumId){
            var sp=new StoredProcedure("Forum_SubToParent",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_ToggleLock(int? Id){
            var sp=new StoredProcedure("Forum_ToggleLock",Provider);
				sp.Command.AddParameter("Id", Id,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Forum_TotalTopicsOrPosts(int? ForumId){
            var sp=new StoredProcedure("Forum_TotalTopicsOrPosts",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("TopicCount",DbType.Int32);
				
	
				sp.Command.AddOutputParameter("PostCount",DbType.Int32);
				
            return sp;
        }
        public StoredProcedure Forum_UpdateLastPost(int? ForumId,int? TotalTopics,int? TotalReplies,string UserName,int? LastPostId,DateTime? LastPostDate,string LastPostTitle){
            var sp=new StoredProcedure("Forum_UpdateLastPost",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("TotalTopics", TotalTopics,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("TotalReplies", TotalReplies,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("UserName", UserName,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("LastPostId", LastPostId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("LastPostDate", LastPostDate,DbType.DateTime,ParameterDirection.Input);
					
				sp.Command.AddParameter("LastPostTitle", LastPostTitle,DbType.String,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure IPLock_Delete(string Ids){
            var sp=new StoredProcedure("IPLock_Delete",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure IPLock_Detail(int? Id){
            var sp=new StoredProcedure("IPLock_Detail",Provider);
				sp.Command.AddParameter("Id", Id,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure IPLock_List(){
            var sp=new StoredProcedure("IPLock_List",Provider);
            return sp;
        }
        public StoredProcedure IPlock_ListAll(){
            var sp=new StoredProcedure("IPlock_ListAll",Provider);
            return sp;
        }
        public StoredProcedure IPLock_Save(int? Id,string Mask,string Reason,DateTime? Expires){
            var sp=new StoredProcedure("IPLock_Save",Provider);
				sp.Command.AddParameter("Id", Id,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Mask", Mask,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Reason", Reason,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Expires", Expires,DbType.DateTime,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Like_List(int? TopicId,int? PageIndex,int? PageSize){
            var sp=new StoredProcedure("Like_List",Provider);
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageIndex", PageIndex,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageSize", PageSize,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Like_Save(int? TopicId,int? FromId,int? ToId,int? Action){
            var sp=new StoredProcedure("Like_Save",Provider);
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("FromId", FromId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("ToId", ToId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Action", Action,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure LogIn(string UserName,string Pwd,bool? IsUpdateLogin){
            var sp=new StoredProcedure("LogIn",Provider);
				sp.Command.AddParameter("UserName", UserName,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Pwd", Pwd,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsUpdateLogin", IsUpdateLogin,DbType.Boolean,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Moderator_Delete(string Ids){
            var sp=new StoredProcedure("Moderator_Delete",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Moderator_Detail(int? Id){
            var sp=new StoredProcedure("Moderator_Detail",Provider);
				sp.Command.AddParameter("Id", Id,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Moderator_List(){
            var sp=new StoredProcedure("Moderator_List",Provider);
            return sp;
        }
        public StoredProcedure Moderator_ListByForum(int? ForumId){
            var sp=new StoredProcedure("Moderator_ListByForum",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Moderator_ListByUserName(string UserName){
            var sp=new StoredProcedure("Moderator_ListByUserName",Provider);
				sp.Command.AddParameter("UserName", UserName,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Moderator_Save(int? UserId,string UserName,int? ForumId,string AccessMask){
            var sp=new StoredProcedure("Moderator_Save",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("UserName", UserName,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("AccessMask", AccessMask,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Notification_Check(int? UserId,bool? IsAdmin,DateTime? LastCheck){
            var sp=new StoredProcedure("Notification_Check",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsAdmin", IsAdmin,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("LastCheck", LastCheck,DbType.DateTime,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Notification_List(int? UserId,bool? IsAdmin,int? PageIndex,int? PageSize){
            var sp=new StoredProcedure("Notification_List",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsAdmin", IsAdmin,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageIndex", PageIndex,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageSize", PageSize,DbType.Int32,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("TotalRows",DbType.Int32);
				
            return sp;
        }
        public StoredProcedure Notification_Save(short? Cmd,int? From,int? To,int? ForumId,int? TopicId,string Location){
            var sp=new StoredProcedure("Notification_Save",Provider);
				sp.Command.AddParameter("Cmd", Cmd,DbType.Int16,ParameterDirection.Input);
					
				sp.Command.AddParameter("From", From,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("To", To,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Location", Location,DbType.String,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Register(string UserName,string Pwd,string Email,double? TimeZone){
            var sp=new StoredProcedure("Register",Provider);
				sp.Command.AddParameter("UserName", UserName,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Pwd", Pwd,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Email", Email,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("TimeZone", TimeZone,DbType.Double,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Report_Save(int? TopicId,int? UserId,string IP,string Reason){
            var sp=new StoredProcedure("Report_Save",Provider);
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("IP", IP,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Reason", Reason,DbType.String,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Request_Save(string Email,string ActiveCode,int? ActionType){
            var sp=new StoredProcedure("Request_Save",Provider);
				sp.Command.AddParameter("Email", Email,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("ActiveCode", ActiveCode,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("ActionType", ActionType,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Role_Delete(string Ids){
            var sp=new StoredProcedure("Role_Delete",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Role_Detail(int? RoleId){
            var sp=new StoredProcedure("Role_Detail",Provider);
				sp.Command.AddParameter("RoleId", RoleId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Role_List(){
            var sp=new StoredProcedure("Role_List",Provider);
            return sp;
        }
        public StoredProcedure Role_Save(int? RoleId,string RoleName,bool? IsAutoStart,bool? IsAdmin,bool? IsSuperModerator,bool? AllowLogin,string CssClass,string AccessMask){
            var sp=new StoredProcedure("Role_Save",Provider);
				sp.Command.AddParameter("RoleId", RoleId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("RoleName", RoleName,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsAutoStart", IsAutoStart,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsAdmin", IsAdmin,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsSuperModerator", IsSuperModerator,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("AllowLogin", AllowLogin,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("CssClass", CssClass,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("AccessMask", AccessMask,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Smile_List(){
            var sp=new StoredProcedure("Smile_List",Provider);
            return sp;
        }
        public StoredProcedure Statistical_ListMaxUsersOnline(){
            var sp=new StoredProcedure("Statistical_ListMaxUsersOnline",Provider);
            return sp;
        }
        public StoredProcedure Statistical_Update(int? PastMinutes){
            var sp=new StoredProcedure("Statistical_Update",Provider);
				sp.Command.AddParameter("PastMinutes", PastMinutes,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Statistical_UpdateMaxUsersOnline(int? PastMinutes){
            var sp=new StoredProcedure("Statistical_UpdateMaxUsersOnline",Provider);
				sp.Command.AddParameter("PastMinutes", PastMinutes,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Subscription_List(int? UserId,short? Type,int? PageIndex,int? PageSize){
            var sp=new StoredProcedure("Subscription_List",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Type", Type,DbType.Int16,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageIndex", PageIndex,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageSize", PageSize,DbType.Int32,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("TotalRows",DbType.Int32);
				
            return sp;
        }
        public StoredProcedure Subscription_Save(int? Id,int? ForumId,int? TopicId,int? UserId,short? NotificationType){
            var sp=new StoredProcedure("Subscription_Save",Provider);
				sp.Command.AddParameter("Id", Id,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("NotificationType", NotificationType,DbType.Int16,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Thread_List(bool? IsModerator,int? TopicId,int? PageIndex,int? PageSize){
            var sp=new StoredProcedure("Thread_List",Provider);
				sp.Command.AddParameter("IsModerator", IsModerator,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageIndex", PageIndex,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageSize", PageSize,DbType.Int32,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("TotalRows",DbType.Int32);
				
            return sp;
        }
        public StoredProcedure Topic_Delete(string Ids,int? ForumId){
            var sp=new StoredProcedure("Topic_Delete",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_Detail(int? TopicId){
            var sp=new StoredProcedure("Topic_Detail",Provider);
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_Feed(int? ForumId,int? PageSize){
            var sp=new StoredProcedure("Topic_Feed",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageSize", PageSize,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_FindPost(int? TopicId,string Action){
            var sp=new StoredProcedure("Topic_FindPost",Provider);
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Action", Action,DbType.AnsiString,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("TotalRows",DbType.Int32);
				
            return sp;
        }
        public StoredProcedure Topic_GetNewPosts(short? ResultType,int? MaxResults,DateTime? LastSearch){
            var sp=new StoredProcedure("Topic_GetNewPosts",Provider);
				sp.Command.AddParameter("ResultType", ResultType,DbType.Int16,ParameterDirection.Input);
					
				sp.Command.AddParameter("MaxResults", MaxResults,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("LastSearch", LastSearch,DbType.DateTime,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_List(int? ForumId,bool? IsModerator,int? PageIndex,int? PageSize,string OrderBy,string Dir){
            var sp=new StoredProcedure("Topic_List",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsModerator", IsModerator,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageIndex", PageIndex,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageSize", PageSize,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("OrderBy", OrderBy,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Dir", Dir,DbType.AnsiString,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("TotalRows",DbType.Int32);
				
            return sp;
        }
        public StoredProcedure Topic_Mod_Delete(string Ids,int? ForumId,bool? IsTopic,bool? IsPost){
            var sp=new StoredProcedure("Topic_Mod_Delete",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsTopic", IsTopic,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsPost", IsPost,DbType.Boolean,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_Mod_MoveToForum(string Ids,int? ForumId,bool? AllowRedirect,DateTime? Expires){
            var sp=new StoredProcedure("Topic_Mod_MoveToForum",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("AllowRedirect", AllowRedirect,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("Expires", Expires,DbType.DateTime,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_Mod_Queue(string Ids,int? ForumId,bool? IsTopic,bool? IsPost,bool? Val){
            var sp=new StoredProcedure("Topic_Mod_Queue",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsTopic", IsTopic,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsPost", IsPost,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("Val", Val,DbType.Boolean,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_Mod_ToggleLock(string Ids,bool? Val){
            var sp=new StoredProcedure("Topic_Mod_ToggleLock",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Val", Val,DbType.Boolean,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_Mod_ToggleSticky(string Ids,short? Priority,DateTime? Expires){
            var sp=new StoredProcedure("Topic_Mod_ToggleSticky",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Priority", Priority,DbType.Int16,ParameterDirection.Input);
					
				sp.Command.AddParameter("Expires", Expires,DbType.DateTime,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_OwnDetail(int? TopicId,bool? Mod,int? UserId){
            var sp=new StoredProcedure("Topic_OwnDetail",Provider);
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Mod", Mod,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_QuoteList(int? TopicId,string Ids){
            var sp=new StoredProcedure("Topic_QuoteList",Provider);
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_Save(int? TopicId,string TopicName,int? ForumId,string Icon,string Message,int? ReplyTo,int? Priority,DateTime? PriorityExpires,bool? IsApproved,string EditedBy,string Reason,string RemoteUrl,string UserName,int? UserId,string IP,string Tags,int? PollId,bool? IncreaseMemberPosts){
            var sp=new StoredProcedure("Topic_Save",Provider);
				sp.Command.AddParameter("TopicId", TopicId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("TopicName", TopicName,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Icon", Icon,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Message", Message,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("ReplyTo", ReplyTo,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Priority", Priority,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PriorityExpires", PriorityExpires,DbType.DateTime,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsApproved", IsApproved,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("EditedBy", EditedBy,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Reason", Reason,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("RemoteUrl", RemoteUrl,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("UserName", UserName,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("IP", IP,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Tags", Tags,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("PollId", PollId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("IncreaseMemberPosts", IncreaseMemberPosts,DbType.Boolean,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("RETURN_VALUE",DbType.Int32);
				
            return sp;
        }
        public StoredProcedure Topic_SearchAdvanced(string Kwd,string Username,string SQL){
            var sp=new StoredProcedure("Topic_SearchAdvanced",Provider);
				sp.Command.AddParameter("Kwd", Kwd,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Username", Username,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("SQL", SQL,DbType.String,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_SearchEngineSitemap(int? PageIndex,int? PageSize){
            var sp=new StoredProcedure("Topic_SearchEngineSitemap",Provider);
				sp.Command.AddParameter("PageIndex", PageIndex,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageSize", PageSize,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_SearchQuick(int? ForumId,bool? IsModerator,string Keyword,short? ResultType,int? MaxResults){
            var sp=new StoredProcedure("Topic_SearchQuick",Provider);
				sp.Command.AddParameter("ForumId", ForumId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("IsModerator", IsModerator,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("Keyword", Keyword,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("ResultType", ResultType,DbType.Int16,ParameterDirection.Input);
					
				sp.Command.AddParameter("MaxResults", MaxResults,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_ToggleApproved(int? Id){
            var sp=new StoredProcedure("Topic_ToggleApproved",Provider);
				sp.Command.AddParameter("Id", Id,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure Topic_ToggleLock(int? Id){
            var sp=new StoredProcedure("Topic_ToggleLock",Provider);
				sp.Command.AddParameter("Id", Id,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_CalcTotalLikes(int? UserId){
            var sp=new StoredProcedure("User_CalcTotalLikes",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_CalcTotalPosts(int? UserId){
            var sp=new StoredProcedure("User_CalcTotalPosts",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_CalcTotalPostsByTopicIds(string Ids){
            var sp=new StoredProcedure("User_CalcTotalPostsByTopicIds",Provider);
				sp.Command.AddParameter("Ids", Ids,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_ChangePassword(int? UserId,string OldPwd,string NewPwd){
            var sp=new StoredProcedure("User_ChangePassword",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("OldPwd", OldPwd,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("NewPwd", NewPwd,DbType.AnsiString,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("RETURN_VALUE",DbType.Boolean);
				
            return sp;
        }
        public StoredProcedure User_EmailExists(string Email){
            var sp=new StoredProcedure("User_EmailExists",Provider);
				sp.Command.AddParameter("Email", Email,DbType.AnsiString,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("RETURN_VALUE",DbType.Boolean);
				
            return sp;
        }
        public StoredProcedure User_ExistsByUserName(string UserName){
            var sp=new StoredProcedure("User_ExistsByUserName",Provider);
				sp.Command.AddParameter("UserName", UserName,DbType.String,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("RETURN_VALUE",DbType.Boolean);
				
            return sp;
        }
        public StoredProcedure User_GetByActiveCode(string ActiveCode,string Email){
            var sp=new StoredProcedure("User_GetByActiveCode",Provider);
				sp.Command.AddParameter("ActiveCode", ActiveCode,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Email", Email,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_InBirthday(){
            var sp=new StoredProcedure("User_InBirthday",Provider);
            return sp;
        }
        public StoredProcedure User_IncreasePosts(int? UserId,int? Increase){
            var sp=new StoredProcedure("User_IncreasePosts",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Increase", Increase,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_Info(int? UserId,string UserNameOrEmail){
            var sp=new StoredProcedure("User_Info",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("UserNameOrEmail", UserNameOrEmail,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_List(int? PageIndex,int? PageSize){
            var sp=new StoredProcedure("User_List",Provider);
				sp.Command.AddParameter("PageIndex", PageIndex,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("PageSize", PageSize,DbType.Int32,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("TotalRows",DbType.Int32);
				
            return sp;
        }
        public StoredProcedure User_ListAll(){
            var sp=new StoredProcedure("User_ListAll",Provider);
            return sp;
        }
        public StoredProcedure User_OnlineList(int? PastMinutes){
            var sp=new StoredProcedure("User_OnlineList",Provider);
				sp.Command.AddParameter("PastMinutes", PastMinutes,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_ResetPwd(int? UserId,string Pwd){
            var sp=new StoredProcedure("User_ResetPwd",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Pwd", Pwd,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_SaveAvatar(int? UserId,string Avatar){
            var sp=new StoredProcedure("User_SaveAvatar",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Avatar", Avatar,DbType.AnsiString,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_SaveEmailPwd(int? UserId,string OldPwd,string NewPwd,string Email){
            var sp=new StoredProcedure("User_SaveEmailPwd",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("OldPwd", OldPwd,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("NewPwd", NewPwd,DbType.AnsiString,ParameterDirection.Input);
					
				sp.Command.AddParameter("Email", Email,DbType.AnsiString,ParameterDirection.Input);
					
	
				sp.Command.AddOutputParameter("RETURN_VALUE",DbType.Boolean);
				
            return sp;
        }
        public StoredProcedure User_SaveNote(int? UserId,string Note){
            var sp=new StoredProcedure("User_SaveNote",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Note", Note,DbType.String,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_SaveProfile(int? UserId,string FullName,string Address,bool? Sex,DateTime? BirthDay,string Website,string Blog,string YahooId,string SkypeId,string MSN,string AOL,string Bio,string Hobby){
            var sp=new StoredProcedure("User_SaveProfile",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("FullName", FullName,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Address", Address,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Sex", Sex,DbType.Boolean,ParameterDirection.Input);
					
				sp.Command.AddParameter("BirthDay", BirthDay,DbType.DateTime,ParameterDirection.Input);
					
				sp.Command.AddParameter("Website", Website,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Blog", Blog,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("YahooId", YahooId,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("SkypeId", SkypeId,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("MSN", MSN,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("AOL", AOL,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Bio", Bio,DbType.String,ParameterDirection.Input);
					
				sp.Command.AddParameter("Hobby", Hobby,DbType.String,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_SaveSignature(int? UserId,string Signature){
            var sp=new StoredProcedure("User_SaveSignature",Provider);
				sp.Command.AddParameter("UserId", UserId,DbType.Int32,ParameterDirection.Input);
					
				sp.Command.AddParameter("Signature", Signature,DbType.String,ParameterDirection.Input);
					
            return sp;
        }
        public StoredProcedure User_ToggleLock(int? Id){
            var sp=new StoredProcedure("User_ToggleLock",Provider);
				sp.Command.AddParameter("Id", Id,DbType.Int32,ParameterDirection.Input);
					
            return sp;
        }
	
	}
	
}
 